#!/bin/bash

# expr
var1=5
var2=6
var3=`expr $var2 \* $var1`
echo The result is $var3

# bracket, no escape
var1=100
var2=50
var3=45
var4=$[$var1 * ($var2 - $var3)]
echo The final result is $var4

# bc
var1=`echo "scale=4; 3.44 / 5" | bc`
echo The answer is $var1

# bc2
var1=10.46
var2=43.67
var3=33.2
var4=71
var5=`bc << EOF
scale = 4
a1 = ($var1 * $var2)
b1 = ($var3 * $var4)
a1 + b1
EOF
`
echo The final answer for this mess is $var5

